package com.boot.springboot.aop;


import com.github.houbb.auto.log.annotation.AutoLog;
import com.github.houbb.auto.log.api.IAutoLogInterceptorContext;
import com.github.houbb.auto.log.core.support.interceptor.autolog.AbstractAutoLogInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * web端下发命令切面拦截器
 */
@Slf4j
@Component
public class MyAutoLogInterceptor extends AbstractAutoLogInterceptor {

   @Override
   protected void doBefore(AutoLog autoLog, IAutoLogInterceptorContext context) {
      Object[] params = context.params();
      log.info("自定义入参:{},{}", Arrays.toString(context.filterParams()));
   }

   @Override
   protected void doAfter(AutoLog autoLog, Object result, IAutoLogInterceptorContext context) {
      Object[] params = context.params();
      log.info("自定义入参:{},{}", Arrays.toString(context.filterParams()));
   }

   @Override
   protected void doException(AutoLog autoLog, Exception e, IAutoLogInterceptorContext context) {

   }
}
